//
//  ViewController.m
//  无限图片轮播器demo
//
//  Created by 刘胤辰 on 16/7/14.
//  Copyright © 2016年 it.com. All rights reserved.
//

#import "ViewController.h"
#import <Masonry.h>
#import "WZHCycleView.h"

@interface ViewController ()<wzhCycleViewDelegate>

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    
    WZHCycleView *cycleView = [WZHCycleView wzhCycleViewWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 140)];
    
    //self.cycleView = cycleView;
    
    cycleView.timeDelay = 2;
    cycleView.autoCycle = YES;
    
    cycleView.netImage = YES;
    
    cycleView.delegate = self;
    
    [self.view addSubview:cycleView];
    
    [cycleView mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.leading.trailing.offset(0);
        make.top.equalTo(self.view.mas_centerY).offset(0);
        make.height.offset(140);
        
    }];
}

#pragma mark - 图片轮播器的代理方法

- (NSArray<NSString *> *)imageArrayForWZHCycleView{
    
    NSArray *imageArray = @[
                            @"http://img.guahao.com/portal_upload/rollingnews/1453447883150.jpg",
                            @"http://img.guahao.com/portal_upload/mediafocus/1461826474435.jpg",
                            @"http://img.guahao.com/portal_upload/rollingnews/1461574027543.jpg",
                            @"http://img.guahao.com/portal_upload/rollingnews/1461574027543.jpg"
                            ];
    //这里提供图片名数组即可,没有就会使用默认的假数据
    return imageArray;
}

- (nullable NSArray <NSString *> *)titleArrayForWZHCycleView{
    
    NSArray *array=@[@"1111111",@"2222222",@"333333333",@"fsdsafas"];
    
    return array;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
